package com.hxq.service;


import cn.hutool.extra.ssh.Sftp;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class SftpService {

    public static void main(String[] args) {
//        Sftp sftp = new Sftp("101.231.206.140", 21221, "1000090847", "Boc@1234");
        Sftp sftp = null;
        try {
            sftp = new Sftp("192.168.1.242", 22, "root", "Panda@@2023##!!");
//            sftp.download("/usr/local/project/panda-index-server/logs/debug.log",new File("D:\\sftp"));
            sftp.recursiveDownloadFolder("/usr/local/project",new File("D:\\sftp"));
        }catch (Exception e){
            throw e;
        }finally {
            sftp.close();
        }

    }
}
